package com.lee.lease.web.app.service.service.impl;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.lee.lease.model.entity.BrowsingHistory;
import com.lee.lease.web.app.mapper.BrowsingHistoryMapper;
import com.lee.lease.web.app.service.BrowsingHistoryService;
import com.lee.lease.web.app.vo.history.HistoryItemVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.Map;

/**
 * @author liubo
 * @description 针对表【browsing_history(浏览历史)】的数据库操作Service实现
 * @createDate 2023-07-26 11:12:39
 */
@Service
@Slf4j
public class BrowsingHistoryServiceImpl extends ServiceImpl<BrowsingHistoryMapper, BrowsingHistory>
        implements BrowsingHistoryService {



    @Override
    public Map findPage(IPage page,Integer id) {
        IPage<HistoryItemVo> pageInfo = baseMapper.findPage(page,id);
        Map data = new HashMap();
        data.put("size", pageInfo.getSize());
        data.put("current", pageInfo.getCurrent());
        data.put("pages", pageInfo.getPages());
        data.put("records", pageInfo.getRecords());
        data.put("total", pageInfo.getRecords().size());

        return data;
    }
}




